package shiro.com.controller.sys;

import java.util.List;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

import shiro.com.basie.controller.BaseController;
import shiro.com.basie.domain.AjaxResult;
import shiro.com.domain.sys.SysRoleTest;
import shiro.com.domain.TableDataInfo;
import shiro.com.mapper.sys.SysRoleTestMapper;
import shiro.com.service.sys.ISysRoleTestService;

import static shiro.com.basie.domain.AjaxResult.success;

/**
 * 【请填写功能名称】Controller
 *
 * @author ruoyi
 * @date 2022-11-01
 */
@CrossOrigin
@RestController
@RequestMapping("/system/test")
public class SysRoleTestController extends BaseController
{
    @Autowired
    private ISysRoleTestService sysRoleTestService;

    /**
     * 查询【请填写功能名称】列表
     */
    @GetMapping("/list")
    public TableDataInfo list(SysRoleTest sysRoleTest)
    {
//        startPage();
        List<SysRoleTest> list = sysRoleTestService.selectSysRoleTestList(sysRoleTest);
        return getDataTable(list);
    }

//
//    /**
//     * 导出【请填写功能名称】列表
//     */
//    @Log(title = "【请填写功能名称】", businessType = BusinessType.EXPORT)
//    @PostMapping("/export")
//    public void export(HttpServletResponse response, SysRoleTest sysRoleTest)
//    {
//        List<SysRoleTest> list = sysRoleTestService.selectSysRoleTestList(sysRoleTest);
//        ExcelUtil<SysRoleTest> util = new ExcelUtil<SysRoleTest>(SysRoleTest.class);
//        util.exportExcel(response, list, "【请填写功能名称】数据");
//    }
//
    /**
     * 获取【请填写功能名称】详细信息
     */
    @GetMapping(value = "/{sysRoleId}")
    public AjaxResult getInfo(@PathVariable("sysRoleId") Long sysRoleId)
    {
        return success(sysRoleTestService.selectSysRoleTestBySysRoleId(sysRoleId));
    }

//    /**
//     * 新增【请填写功能名称】
//     */
//    @PreAuthorize("@ss.hasPermi('system:test:add')")
//    @Log(title = "【请填写功能名称】", businessType = BusinessType.INSERT)
//    @PostMapping
//    public AjaxResult add(@RequestBody SysRoleTest sysRoleTest)
//    {
//        return toAjax(sysRoleTestService.insertSysRoleTest(sysRoleTest));
//    }
//
//    /**
//     * 修改【请填写功能名称】
//     */

    @PutMapping
    public AjaxResult edit(@RequestBody SysRoleTest sysRoleTest)
    {
        return toAjax(sysRoleTestService.updateSysRoleTest(sysRoleTest));
    }


//
//    /**
//     * 删除【请填写功能名称】
//     */
//    @PreAuthorize("@ss.hasPermi('system:test:remove')")
//    @Log(title = "【请填写功能名称】", businessType = BusinessType.DELETE)
//	@DeleteMapping("/{sysRoleIds}")
//    public AjaxResult remove(@PathVariable Long[] sysRoleIds)
//    {
//        return toAjax(sysRoleTestService.deleteSysRoleTestBySysRoleIds(sysRoleIds));
//    }
}
